<?php

//********************************
//	File:		index.php
//	Author:		Philip Pryce
//	Date:		20th July 2008
//	Comments:	This is where all the magic happens, everything gets set and pushed to the browser here.
//********************************

// You need to edit the following settings and make sure their right before
// you run Submind for the first time.

// -------
// The Application directory, where all your views, models and controllers will be kept.
// NO TRAILING SLASH!
// -------
$application_dir = 'application';

 
// -------
// The System directory where all your system files such as librarys will be kept.
// NO TRAILING SLASH!
// -------
$system_dir = 'system';

// -------
// Your Web URL, you need to change this to the url you visit to see your submind installation.
// NO TRAILING SLASH!
// -------
$web_url = 'http://81.98.44.208/Submind'; 


// 
// -- No need to edit from here on in, do so at your own risk.
//


// -------
// WEBURL
// -------
define('WEBURL', $web_url . '/');

// -------
// BASE: the directory everything should be in.
// -------
define('BASE', dirname(__FILE__) . '/');

// -------
// APP: the application directory, if the $aplication_dir starts with a slash, we wont put the BASE at the start.
// -------
if ($application_dir[0] != '/') {
	define('APP', BASE . $application_dir . '/');
}
else {
	define('APP', $application_dir . '/');
}

// * SYS: the system directory, if the $system_dir starts with a slahs, we wont put the BASE at the start.
if ($system_dir[0] != '/') {
	define('SYS', BASE . $system_dir . '/');
}
else {
	define('SYS', $system_dir . '/');
}

// * _DEBUG: turn on debugging? true/false
define('_DEBUG', true);

// Tick Tock...
if (_DEBUG) {
	// start the clock going!
	$timeparts = explode(' ',microtime());
	$starttime = $timeparts[1].substr($timeparts[0],1);
}

// Lets turn on error reporting completely for debug mode.
error_reporting(_DEBUG ? E_ALL : 0);

// lets include all the important stuff so it all works.
include_once(SYS . 'submind/submind.php');

// Start up the framework!
$Framework = new Submind();


// lets do some in-depth debugging!
if (_DEBUG) {
	
	// stop the clock! lets see the results...
	$timeparts = explode(' ',microtime());
	$endtime = $timeparts[1].substr($timeparts[0],1);
	// not too shabby...
	$runtime = bcsub($endtime,$starttime,6);
	
	echo '<div class="debugging">';
	echo '<h1>Debug - Runtime: ' . $runtime . '</h1>';
	echo '<pre>';
	var_dump($Framework);
	echo '</pre>';
	echo '</div>';
}
?>